from Clases.Signal import Signal

class ManagerInterrupt():
    
    def __init__(self):
        self.kernel =None
        
    def getKernel(self):
        return self.kernel
     
    def setKernel(self,kernel):
        self.kernel = kernel
                
    def interrupt(self, signal): 
       
        if signal is Signal.RESCHEDULE:
            self.kernel.reschedule()
        if signal is Signal.EXIT:
            self.kernel.exit()
        if signal is Signal.NEW:
            if self.kernel.cpu.pcb is None:
                self.kernel.reschedule()
        if signal is Signal.SWAP:
            self.kernel.swap();
